import { useEffect, useState } from 'react';
import { IRouteComponentProps } from 'umi';
import useStore from '@/context/useStore';
import styles from './interviewRecord.less'
import { observer } from 'mobx-react-lite'
import {Button,message} from 'antd'
const issoundrecord=['无','有']
const status = ['不确定', '通过', '未通过' ];
const interviewRecord:React.FC<IRouteComponentProps>=({location,history})=>{
   let id=location.query.interviewId
   let [flag,setflag]=useState(false)
  let { InterRecord } = useStore();
    useEffect(()=>{
      InterRecord.getinterRecord(id as string)
    },[])
    const success = () => {
      setflag(!false)
      if(flag){
        message.success('取消屏蔽')
      }else{
        message.success('屏蔽成功');
      }
     
    };
    return <div className={styles.inter}>
      <div>
        <section>
          <h2>查看面试记录</h2>
          <div className={styles.but}>
            <Button className={styles.back} onClick={()=>{history.go(-1)}}>返回</Button>
            <Button className={styles.no} onClick={success} type='primary'>屏蔽</Button>
          </div>
        </section>
        <div className={styles.recordcon}>
          <div className={styles.other}>
            <div className={styles.one}>
              <h3>岗位名称：{InterRecord.interDetail.stationName}</h3>
              <h3>公司名称：{InterRecord.interDetail.companyName}</h3>
            </div>
            <div className={styles.two}>
              <h3>面试时间：{InterRecord.interDetail.interviewTime}</h3>
              <h3>时长：{InterRecord.interDetail.duration}</h3>
            </div>
            <div className={styles.three}>
              <h3>地点：{InterRecord.interDetail.site}</h3>
              <h3>面试官：{InterRecord.interDetail.intervierManagement}</h3>
            </div>
            <div className={styles.four}>
              <h3>专业：{InterRecord.interDetail.majorName}</h3>
              <h3>提交人：{InterRecord.interDetail.commitName}</h3>
            </div>
            <div>
              <h3>记录-吐槽：<img className={styles.img} src="http://111.203.59.61:8060/file_service/group1/M00/00/1E/rBsCHGDBjuaAPgHUAAE7d5JxQbE64.jpeg" alt="" /></h3>
              <h3>面试结果：{status[InterRecord.interDetail.status]}</h3>
              <h3>录音文件：{issoundrecord[InterRecord.interDetail.issoundrecord]}</h3>
              <div className={styles.seven}>
                <h3>面试问题：</h3>
                <p>请如实填写面试问题和答案，面试中没有作答的题目可略过答案填写，直接输入问题即可。</p>
              </div>
              <div className={styles.five}>
                <p>问</p><span>:测试提问问题</span>
              </div>
              <div className={styles.six}>
                <p>答</p><span>：测试提问问题</span>
              </div>
            </div>
          </div>
          {flag ? <div className={styles.active}>
              <img src="http://111.203.59.61:8060/static/img/shield.69691644.svg" alt="" />
            </div> : ''}
      </div>
        </div>
        
    </div>
    
}
export default observer(interviewRecord)
